<?php
@$admin=$_REQUEST['admin3'];
@$pwd=$_REQUEST['password3'];
if(!empty($admin) && !empty($pwd)){
    $pdo=new PDO('mysql:dbname=shuju;charset=utf8','root');
    $use=$pdo->prepare('select admin from yuangong where admin=:aa');
    $use->execute(array('aa'=>$admin));
    $data=$use->fetchAll(PDO::FETCH_NAMED);
    if(!empty($data)){
        $usemm=$pdo->prepare('select * from yuangong where admin=:b1 and password=:b2');
        $usemm->execute(array('b1'=>$admin,'b2'=>$pwd));
        $datamm=$usemm->fetchAll(PDO::FETCH_NAMED);
        if(!empty($datamm)){
            if(@$datamm[0][power]=='boss'){
                session_start();
                $_SESSION["ZHb"]=$admin;
                echo "boss";
            }
            if(@$datamm[0][power]=='zhuguan'){
                session_start();
                $_SESSION["ZHz"]=$admin;
                echo "zhuguan";
            }
            if(@$datamm[0][power]=='salesman'){
                session_start();
                $_SESSION["ZHs"]=$admin;
                echo "salesman";
            }
            if(@$datamm[0][power]=='employ'){
                session_start();
                $_SESSION["ZHe"]=$admin;
                echo "employ";
            }

        }else{
            echo "mmF";
        }
    }else{
        echo "zhF";
    }

}
?>